home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 14 / Mac Magazin and MacEasy Magazine CD - Issue 14.iso / Utilities / Grabbug1.0b2 Folder / Source / GrabbugDump.p < prev    next >
Encoding:
Text File  |  1995-08-24  |  1.1 KB  |  64 lines  |  [TEXT/MWPS]

  1. program GrabbugDump;
  2.  
  3. (* ©1995 Quinn "The Eskimo!" *)
  4. (* This file is distributed as Freeware. *)
  5.  
  6. (* Compiled using Metrowerks Pascal 1.1.1 (the CW 6.1 release). *)
  7.  
  8.     uses
  9.         QuickDraw,
  10.         TextUtils,
  11.         Fonts,
  12.         Windows,
  13.         Menus,
  14.         TextEdit,
  15.         Dialogs,
  16.         
  17.         GrabbugCommon;
  18.  
  19.     const
  20.         rErrorStrings = 128;
  21.         rErrorAlert = 128;
  22.         
  23.     var
  24.         err : OSErr;
  25.         junk : integer;
  26.         errmsg : Str255;
  27.         errstr : Str255;
  28.         errndx : integer;
  29. begin
  30.     (* initialise the toolbox. *)
  31.     InitGraf(@qd.thePort);
  32.     InitFonts;
  33.     InitWindows;
  34.     InitMenus;
  35.     TEInit;
  36.     InitDialogs(nil);
  37.     MaxApplZone;
  38.     (* call GrabbugCommon to dump out the PICT *)
  39.     err := DoDump;
  40.     (* process and display the error *)
  41.     if err <> noErr then begin
  42.         NumToString(err, errstr);
  43.         case err of
  44.             noDcmdErr :
  45.                 errndx := 2;
  46.             screenSizeChangedErr :
  47.                 errndx := 3;
  48.             noMainGDeviceErr :
  49.                 errndx := 4;
  50.             memFullErr :
  51.                 errndx := 5;
  52.             noGrabErr :
  53.                 errndx := 6;
  54.             screenSizeChangedErr2 :
  55.                 errndx := 7;
  56.         otherwise
  57.             errndx := 1;
  58.         end; (* case *)
  59.         GetIndString(errmsg, rErrorStrings, errndx);
  60.         ParamText(errmsg, errstr, '', '');
  61.         junk := StopAlert(rErrorAlert, nil);
  62.     end; (* if *)
  63. end. (* GrabbugDump *)
  64.